import { questionDetail } from '../Model/QuestionDetail'
import { http } from '../utils/http'
import { AlertDialog } from '@kit.ArkUI'

interface params{
  id:string
}
interface tokenData {
  data: questionDetail,
  message: string,
  code: number
}
interface optparams{
  id:string
  type:number
  optType:number
}
export const QuestionDetail = (data:params): Promise<tokenData> => {

  return http.get<tokenData>(`question/${data.id}`)
}
export const QuestionOpt = (data:optparams): Promise<tokenData> => {

  return http.post<tokenData>(`question/opt`,data)
}
export const QuestionunOpt = (data:optparams): Promise<tokenData> => {

  return http.post<tokenData>(`question/unOpt`,data)
}